package it.alertManager.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;


public class AlertManagerMainActivity extends Activity {
	
	private static final String LOG_CLASS_NAME = AlertManagerMainActivity.class.getName();
	//private IAlertManagerService alertManagerService = null;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

	public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.configuration_menu, menu);
        menu.getItem(0).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
			
			public boolean onMenuItemClick(MenuItem item) {
				startActivity(new Intent(AlertManagerMainActivity.this, ConfigurationActivity.class));
	            // This is a more complicated animation, involving transformations
	            // on both this (exit) and the new (enter) activity.  Note how for
	            // the duration of the animation we force the exiting activity
	            // to be Z-ordered on top (even though it really isn't) to achieve
	            // the effect we want.
	            overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);	
	            return true;
			}
		});
        Log.d(LOG_CLASS_NAME, "onCreateOptionsMenu");
        return true;
    }

	@Override
	protected void onDestroy() {
		Log.d(LOG_CLASS_NAME, "Enter onDestroy");
		super.onDestroy();
		Log.d(LOG_CLASS_NAME, "Exit onDestroy");
	}

}